const { body, checkSchema, check } = require("express-validator");

const companyInfoValidation = {
  update_companyInfo_validation: checkSchema({
    title: {
      notEmpty: true,
      trim: true,
      escape: true,
      errorMessage: "请输入公司名称",
    }, // 必填
    desc: {
      notEmpty: true,
      trim: true,
      escape: true,
      errorMessage: "请输入公司简介",
    }, // 必填
    address: {
      notEmpty: true,
      trim: true,
      escape: true,
      errorMessage: "请输入公司地址",
    }, // 必填
    phone: {
      notEmpty: true,
      trim: true,
      escape: true,
      errorMessage: "请输入公司电话",
    }, // 必填
    email: {
      trim: true,
      escape: true,
      notEmpty: {
        errorMessage: "请输入公司邮箱",
      },
      isEmail: {
        errorMessage: "请输入正确的邮箱格式",
      },
    },
  }),
};

module.exports = companyInfoValidation;
